package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Phone    string `json:"Phone"`
	Password string `json:"Password"`
}

func (u *User) UserAdd(db *gorm.DB) error {

	return db.Debug().Create(u).Error

}

func (u *User) UserFind(db *gorm.DB, phone string) error {

	return db.Debug().Where("phone=?", phone).Find(u).Error

}
